package com.tg.service.child.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * 配置加载顺序:
 * @PropertySource注解优先级低于jar包内的application.properties，会被覆盖
 */
@PropertySource(value = {"classpath:child.properties"})
public class ChildPropertyConfig {

    @Value("${child.pro}")
    private String test;

    public String getTest() {
        return test;
    }

    public void setTest(String test) {
        this.test = test;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"test\":\"").append(test).append('\"');
        sb.append('}');
        return sb.toString();
    }
}
